package com.lhs.store.application.net;

import java.io.IOException;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import retrofit2.Retrofit;

public class HttpTools {
//    public static void main(String[] args) throws IOException {
//        String url = "http://test.nfcpwl.com:21100/ding/businessData?key=85b47549db0e3398aebbd91796c8d99f&entryId=2&businessId=1002";
//        HttpTools ht = new HttpTools();
//        System.out.println(ht.run(url));
//
//    }
    OkHttpClient client = new OkHttpClient();
    public String run(String url) throws IOException{
        Request request = new Request.Builder()
                .url(url)
                .build();
        Response response = client.newCall(request).execute();
        return response.body().string();
    }
    public void test(){
        String url = "http://test.nfcpwl.com:21100/ding/businessData?key=85b47549db0e3398aebbd91796c8d99f&entryId=2&businessId=1002";
        Retrofit retrofit =  new Retrofit.Builder()
                .baseUrl(url)
                .build();

    }

//    public String post(String url,String json) throws IOException {
//
//    }
}
